Copy link to clipboard
Copied
When I create a new row in a table (control click in a cell > Table > Insert Rows or Columns) the cell is formatted by default as None. I would like cells in new rows to be formatted as Paragraph.
I have done extensive searches, but haven't found an answer.
Well it may if the intended CSS styles are applied to <p> tags and not <td> tags.
By @Nancy OShea
isn't it easiest to add a , td to the p rules,
as
before
p {
/* any description */
}
after
p, td {
/* any description */
}
than adding a P tag deep in the butter just to get a styled content.. except as @L e n a point at for a semantic need (Well I don't personnaly see any P semantic need in within a TD)
Copy link to clipboard
Copied
Cells are not styled as paragraphs. Paragraphs are styled as paragraphs.
By way of example:
<table border="1" cellpadding="5">
<tr>
<th><h1>Heading</h1></th>
<th><h1>Heading</h1></th>
<th><h1>Heading</h1></th>
</tr>
<tr>
<td><p>This is a paragraph....</p></td>
<td><p>This is a paragraph....</p></td>
<td><p>This is a paragraph....</p></td>
</tr>
</table>
That said, Tables are for tabular data only (charts & spreadsheets). Use CSS for webpage layouts.
Copy link to clipboard
Copied
These are labels and sentences within cells. What I'm referring to is the paragraph format that contains my font choice, as shown in the inspector.
The data is (are?) tabular. The page is just a simple table with many rows. No embedded tables.
I think in the past a new row had the correct formatting as a default, but I must have changed something.
Here's an example:
<tr style="font-family: 'Gill Sans', 'Gill Sans MT', 'Myriad Pro', 'DejaVu Sans Condensed', Helvetica, Arial, sans-serif">
<td width="234" bgcolor="#FAF9F9"><p>Morocco </p></td>
<td><p>1930</p></td>
<td width="207"><p>Gary Cooper<br>
Marlene Dietrich<br>
Adolphe Menjou<br>
Eve Southern<br>
Ullrich Haupt </p>
<p>Director:<br>
Josef von Sternberg </p></td>
<td><p><img src="picsdate/morocco.jpg" width="240" height="205" alt=""/></p></td>
<td><p>Madame Caesar, (Eve Southern), blah, blah.<br>
Several other shots in this set show Thonet No. 18s.</p></td>
</tr>
I'm aware that, with a lot of work, I could recreate the table with CSS.
Copy link to clipboard
Copied
Using inline styles in HTML code is confusing and easy to break styles. It would be better if styles were kept in a separate stylesheet. The only time we use inline styles is when creating emails.
I would use definition lists for this.
https://www.the-art-of-web.com/css/format-dl/
Copy link to clipboard
Copied
I'm aware that, with a lot of work, I could recreate the table with CSS.
By @habronattus
nope, it's pretty easy and fast...
well, launch a search and replace advanced TAB for handling the three below opérations
then apply your CSS in one shot
but as @Nancy OShea recommand , the use of DL, DT and DD are there for this type of purpose (among others) https://developer.mozilla.org/fr/docs/Web/HTML/Element/dl
Copy link to clipboard
Copied
I don't understand your expectations.
by inserting a new row TR, necessarily the new cell content will be either TH, or TD... but not P
the question is... what do you want to achieve... a visual of your TH and TD cells that is based on the visual used by your P tags?
or do you want your cells to automatically contain paragraphs in the form of P tags... so a semantic meaning... for what interest ?
Copy link to clipboard
Copied
Totally agree with @L e n a , <td><p>This is a paragraph....</p></td> does not require a P-tag.
Copy link to clipboard
Copied
<td>
<p>This is a paragraph....</p></td> does not require a P-tag.
By @BenPleysier
============
Well it may if the intended CSS styles are applied to <p> tags and not <td> tags.
Copy link to clipboard
Copied
Well it may if the intended CSS styles are applied to <p> tags and not <td> tags.
By @Nancy OShea
isn't it easiest to add a , td to the p rules,
as
before
p {
/* any description */
}
after
p, td {
/* any description */
}
than adding a P tag deep in the butter just to get a styled content.. except as @L e n a point at for a semantic need (Well I don't personnaly see any P semantic need in within a TD)
Copy link to clipboard
Copied
"after
p, td"
Thank you. That's exactly what I was looking for.
Copy link to clipboard
Copied
"after
p, td"
Thank you. That's exactly what I was looking for.
By @habronattus
glad that it helped you
Copy link to clipboard
Copied
We have no idea if there is any external stylesheet. This is all just guesswork.
Copy link to clipboard
Copied
We have no idea if there is any external stylesheet. This is all just guesswork.
By @Nancy OShea
I'm curious to understand what will be the difference in this particular thread and question ?
Copy link to clipboard
Copied
In the absence of ANY stylesheet, there are no paragraph or table cell styles to call on. It's just an unformatted table.
Copy link to clipboard
Copied
In the absence of ANY stylesheet, there are no paragraph or table cell styles to call on. It's just an unformatted table.
By @Nancy OShea
well, maybe my English is not correct, but I did understand that styles were used when reading this...
What I'm referring to is the paragraph format that contains my font choice, as shown in the inspector.
I'm aware that, with a lot of work, I could recreate the table with CSS.
By @habronattus
Copy link to clipboard
Copied
I do have a CSS stylesheet. I just changed the p to p, td in the .css file as B i r n o u suggested above.
Now a new row has the font I want and I don't have to insert a paragraph.
Copy link to clipboard
Copied
I appreciate the fact of getting a correct answer, but in fact I was answering to @Nancy OShea by just reformulating what was said as a first comment by @L e n a
nope, it's pretty easy and fast...
well, launch a search and replace advanced TAB for handling the three below opérations
- remove all attribute in TR and TD tags
- remove all P tag (just the cleaning tag, not the physical removing)... I mean cleaning will remove the tag itself not the content
- you can leav the BR on
then apply your CSS in one shot
By @L e n a
Copy link to clipboard
Copied
Hi Habronattus, Happy Wednesday. If you are using Tables to layout web pages you are a rockstar. Boostrap is so much easier than tables. Trust me. Here see for yourself. https://youtu.be/kqH7ORdVzNg
Have a happy day.