Home > Web Front-end > HTML Tutorial > When the data in the table is empty, the border of td is not displayed? _html/css_WEB-ITnose

When the data in the table is empty, the border of td is not displayed? _html/css_WEB-ITnose

WBOY
Release: 2016-06-24 12:10:43
Original
1379 people have browsed it

In addition to adding spaces, can you use css style control?


Reply to discussion (solution)

You can write CSS .td {solid 10px red} Like this. .

FF right?
Are the width and height given? It seems that I have encountered it at that time. Didn't think of a better way.

The method on the first floor doesn’t work. .

Baidu can do it

Just add .

Just put a space in it and that should solve the problem. . .

This problem seems to only exist in FireFox. The easiest way is to add a space in it.
I’ve tried everything else but haven’t been able to get it right.

<!doctype html><html>    <head>        <meta charset="gb2312" />        <title></title>        <style>			table{ border-collapse:collapse;}            td{ width:100px; height:40px; padding:10px; border:1px solid red; text-align:center;}        </style>    </head>    <body>        <table>            <thead>                <tr>                    <td>1</td>                    <td>2</td>                    <td>3</td>                </tr>            </thead>            <tbody>                <tr>                    <td>1-1</td>                    <td>1-2</td>                    <td>1-3</td>                </tr>                <tr>                    <td>2-1</td>                    <td>2-2</td>                    <td>2-3</td>                </tr>                <tr>                    <td></td>                    <td>3-2</td>                    <td>3-3</td>                </tr>            </tbody>        </table>    </body></html>
Copy after login

css table add
border-collapse: collapse;

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template