Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Question regarding borders in tables 1

Status
Not open for further replies.

CHeighlund

Programmer
Jun 11, 2007
163
US
I'm trying to lay out the design framework for a table-based report I've been requested to put together, and I'm running into a few problems. In trying to imitate the current dead-tree format report, I ended up creating sub-tables within the main table at a few points to display some items in the same manner. (I know there's probably an easier way around this than using internal tables; if anyone has that to offer, I'm all ears.)

For some reason, my cells aren't completely lined up the way I expected them to be. And I can't do a direct comparison, because I don't have any cell borders. The table itself has a border, as do the subtables, because of the way I built them in the code:
Code:
<table rules = groups border = 1 width = 100%>

Why won't the individual cell borders show up? The HTML text I'm working with doesn't seem to show anything about cell borders in the tables segment, and the example pages in the book all appear to have borders around every cell.

What do I need to change in order to give the cells themselves borders?
 
Because of your rules attribute: rules = groups

Remove that and you should get borders around the cells also.


Also, perhaps if you tell us what the layout should be like, we can come up with an alternative to tables. which unless you are showing tabular data, should not be used.

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I'm fairly sure that a table would be the best way to go about this, I'm just not sure how to match a few cells up on it. This is, I presume, attributable to my limited understanding of tables.

I've done a rough mockup of the section of the paper-format version of the original report that's giving me trouble.


The line in green on that thing is the first line the actual data will begin. That line is repeated until the end of the page in the paper format, but it's simple enough that I don't believe I would have any problems with it; it's the stuff above it that's causing me problems.
 
O.K so of all those boxes which ones will actually contain "tabular" data. Which ones will only contain anything at all. By the distribution it seems unlikely everything will contain text or information.

As I mentioned above, remove the rules=group attribute from your table, and you'll get the borders.

Also depending on how you are defining the different sizes of the cells, it maybe be affecting the rest of the table.

Also if I where doing that I would separate the top section from where the actual data will begin.

It seems everything over the green line where you say actual data will begin can be, and should be accomplished without a table, since it looks to me like its just header information and not tabular data.


----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
I'm still trying to figure out what you mean by 'tabular' in this case.

The report data will be drawn from a database. The information in the green blocks, and the rows below them, are what will be getting filled out. The white blocks are descriptive headings to identify what the data below represent. And yes, every single block will have something in it.

Please clarify for me what it is I seem to be missing here.
 
From what I can gather, your data from the database, which would be considered tabular starts at the green line.

It just seems to me theres a somewhat excessive amount of boxes there.

Still I may be missing the big picture.

And by tabular data, I mean data that can be represented in tables. Rows and Columns.

Layout, like the positioning of elements is not considered tabular data.



----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Do you have a better schematic of how it should look like with actual text/graphics filled in. Becuase the boxes you showed us seem a bit vague.

___________________________________________________________
[small]Do something about world cancer today: Comprehensive cancer control information at PACT[/small]
 
I take it that the white parts of your image are headings for the data contained in the green parts, with some headings spanning several columns.

You can (and should) do this with a single <table> element, just investigate the [tt]colspan[/tt] and [tt]rowspan
[/tt] attributes of <td> and (especially) <th> elements.

A quick example:
Code:
<table>
<tr>
<th rowspan="2">School Region</th>
<th colspan="2">Gender</th>
</tr>
<tr>
<th>Male</th>
<th>Female</th>
</tr>
<tr>
<td>North</td>
<td>1010</td>
<td>1021</td>
</tr>
<tr>
<td>Central</td>
<td>981</td>
<td>970</td>
</tr>
<tr>
<td>South</td>
<td>1120</td>
<td>1110</td>
</tr>
</table>



-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Thank you to ChrisHunt, this looks to be exactly what I needed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top