Problem with cell width in a table

Hi there,
I searched the forum but found nothing, all too sophisticated.
I have a problem with the cell width in a table.
The row is divided in 3 equal columns, the next row should take the whole width of the table.
EDIT:
I looked closer.It seems it does not use the class “tablenorm” at all.
In my css-file I have:

body {
  background-color: DarkKhaki 
}

.tablenorm{
    width: 100%;
    font-weight: normal;
    color: blue;
    border: 5px;
    border-color: black;
}
.nombre{
    font-weight: bold;
    color: blue;
    background: Moccasin;
    width: 10%;
    vertical-align: top;
}
.datum{
    font-weight: bold;
    color: green;
    background: Moccasin;
    width: 33%;
    vertical-align: top;
}
.header{
    font-weight: bold;
    color: orange;
    background: Moccasin;
    width: 33%;
    vertical-align: top;
}
.textarea{
    font-weight: normal;
    color: black;
    background: yellow;
    width: 100%;
    height: 100px;
    vertical-align: top;
}
.buttons{
    font-weight: normal;
    color: black;
    background: green;

}

and my table is defined as follows:

<table class="tablenorm">
<tr>
<td class=nombre>
Name/Nombre
</td>
<td class="header";
Headline
</td>
<td class="datum";
ID:28 2019-09-26 9:11
</tr>
<tr>
</td>

<td class="textarea">
Text
</td>
</tr>

What happens, is that the first column in line 1 (nombre) takes all the space in the line, and the two other columns are only seen as vertical lines,
If i remove the 100% for the textarea, the 3 columns are shown as they should, but then the textarea has the width of the first column in line 1.
You can see it at

bahia-dorada.es/messageboard.php

I am grateful for any help!

Have you tried validating your HTML? That might give a clue.

1 Like

You can’t span cells unless you use the colspan attribute.

Fixed width cells need the table-layout:fixed algorithm applied to the table element.

As mentioned above you also have errors that need fixing first.

Hi gandalf458.

It seems I have grave problems in all.
It doesn’t even like

<?php include 'mysqlopen.php'?>

Wrong quatation. I haveto look up this first.
Thank you

The validator won’t like your PHP code. You shouldn’t be giving the validator your raw source code, but rather point the validator to your online page.

But, yes, you do have a few things to sort out.

Indeed.
I cleaned up everything, so only one error stands out, the one which makes me headache:

    Warning: A table row was 1 columns wide, which is less than the column count established by the first row (3).

    From line 43, column 6; to line 44, column 5

    Text↩</td>↩</tr>↩↩</ta

It must be about these lines:


<table class="tablenorm">
<tr>
<td class=nombre>
Name/Nombre
</td>
<td class="header">
Headline
</td>
<td class="datum">
ID:28 2019-09-26 9:11
</tr>
<tr>

<td class="textarea">
Text
</td>
</tr>

</table>

I can’t see anything wrong. Does the first row in a table decide for all following?

You must have missed this then.

Ok thanks,
I’ll dive into the literature about this then. On paper it’s so easy to draw some lines lol

1 Like

Marvelous! Thank you

1 Like

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.