I am using a table to display data pulle开发者_StackOverflow社区d from two database tables. I am trying to put the information in two rows seperated by a hr tag to create a line between them. However the last cell (in this case) does not have anything to be input into the bottom of it. It here a character that is the same height as a letter that I can put in there to make the hr tag line up with the others while still not being visible to the user?
To get a table cell to appear, you need to have a character in it. To add an invisible character, generally, a non-breaking space is used. This is created using the
HTML entity.
To get a blank character, use the following HTML entity:
In order to draw lines, however, I would not use an <hr>
.
Use CSS to define your table borders:
table td {
border:1px solid #ccc;
padding:1px;
}
You can do this at the table, row, or cell level (or any HTML element for that matter), which makes it very flexible, and renders the hr
tag superfluous in this instance.
精彩评论