Typo3 列宽不和谐

发布于 2024-12-14 04:46:19 字数 4539 浏览 0 评论 0原文

我正在尝试对我的代理机构网站上的某些内容进行故障排除。具体来说,这个:

http://tinypic.com/r/rwuul0/5

我关心的是右边那个烦人的栏里有联系信息。尽管标记很严格(据我所知),但它并没有排队。相信我,我也讨厌表格,但我们也在后端使用 Typo3 CMS,并且它坚持将所有数据格式化为这样:

<table cellspacing="0" cellpadding="0" border="0" style="left:4px; border-collapse:collapse">
  <tbody>
    <tr>
      <td class="first_td">
        <p><b><span style="font-size:10.0pt;" lang="DE-CH">Bayer International SA</span></b></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="DE-CH">Badische   Bahnhofstrasse 16</span></p>
        <p style="margin-right:1.35pt"><span style="font-size: 10pt; " lang="DE-CH">CH-</span><span style="font-size:10.0pt" lang="DE-CH">8212 </span><span style="font-size:10.0pt" lang="DE-CH">Neuhausen am Rheinfall</span></p>
      </td>
      <td width="50" valign="top" style="width:49.6pt; padding:0cm 5.4pt 0cm 5.4pt">
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="EN-US">T</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="EN-US">F</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="EN-US">Website</span></p>
      </td>
      <td width="131" valign="top" style="width:131.4pt; padding:0cm 5.4pt 0cm 5.4pt">
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="EN-US">+41 52 674 99 36</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="EN-US">+41 52 670 05 59</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="EN-US"><a external="1" target="_blank" href="http://www.bayer.com/">www.bayer.com</a></span></p>
      </td>
    </tr>
  </tbody>
</table>

令人讨厌,不是吗?这是从 Typo3 返回的第四个条目的标记。这是第五个条目的标记:

<table style="left:4px; border-collapse:collapse" border="0" cellpadding="0" cellspacing="0">
  <tbody>
    <tr>
      <td class="first_td">
        <p><b><span style="font-size:10.0pt;" lang="DE-CH">Constellium   Specialty Sheet</span></b></p>
        <p><span style="font-size:10.0pt" lang="DE-CH">Engineered   Products Switzerland Ltd.</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="DE-CH">Badische   Bahnhofstrasse 16</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="DE-CH">CH-8212 Neuhausen am Rheinfall</span></p>
        <p><b><span style="font-size:10.0pt" lang="DE-CH">&nbsp;</span></b></p>
      </td>
      <td style="width:49.6pt; padding:0cm 5.4pt 0cm 5.4pt" valign="top" width="50">
        <p style="margin-right:1.35pt">&nbsp;</p>
        <p style="margin-right: 1.35pt; "><span style="font-size: 10pt; " lang="ES">T</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="ES">F </span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="ES">Website</span></p>
      </td>
      <td style="width:49.6pt; padding:0cm 5.4pt 0cm 5.4pt" valign="top" width="50">
        <p style="margin-right:1.35pt">&nbsp;</p>
        <p style="margin-right: 1.35pt; "><span style="font-size: 10pt; " lang="ES">+41 52 674 91 11</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="ES">+41 52 674 96 01</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="ES"><a external="1" target="_blank" href="http://www.constellium.com/">www.constellium.com</a> </span></p>
      </td>
    </tr>
  </tbody>
</table>

“first_td”类似乎是通过 Typo3 动态生成的,因为 CSS 显示在 index.php 上。我尝试过在 中强制列宽内联,但它仍然不和谐。 Chrome 的开发者工具也没有任何帮助;它显示了正确的 CSS,但很容易承认列宽不是应有的宽度。

我在这里做错了什么?代码中是否有我没有看到的内容,或者 Typo3 是否会破坏某些内容?如果您能想到任何事情,我将不胜感激。

I'm trying to troubleshoot some content my agency has on a site. Specifically, this:

http://tinypic.com/r/rwuul0/5

My concern is with that pesky column on the right with the contact information. It's not lining up, despite the markup being rigid (as far as I can tell). Trust me, I hate tables too, but we're also using the Typo3 CMS for the backend, and it insists on formatting all data as such:

<table cellspacing="0" cellpadding="0" border="0" style="left:4px; border-collapse:collapse">
  <tbody>
    <tr>
      <td class="first_td">
        <p><b><span style="font-size:10.0pt;" lang="DE-CH">Bayer International SA</span></b></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="DE-CH">Badische   Bahnhofstrasse 16</span></p>
        <p style="margin-right:1.35pt"><span style="font-size: 10pt; " lang="DE-CH">CH-</span><span style="font-size:10.0pt" lang="DE-CH">8212 </span><span style="font-size:10.0pt" lang="DE-CH">Neuhausen am Rheinfall</span></p>
      </td>
      <td width="50" valign="top" style="width:49.6pt; padding:0cm 5.4pt 0cm 5.4pt">
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="EN-US">T</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="EN-US">F</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="EN-US">Website</span></p>
      </td>
      <td width="131" valign="top" style="width:131.4pt; padding:0cm 5.4pt 0cm 5.4pt">
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="EN-US">+41 52 674 99 36</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="EN-US">+41 52 670 05 59</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="EN-US"><a external="1" target="_blank" href="http://www.bayer.com/">www.bayer.com</a></span></p>
      </td>
    </tr>
  </tbody>
</table>

Obnoxious, ain't it? That's the markup for the fourth entry that is returned from Typo3. Here's the markup for the fifth entry:

<table style="left:4px; border-collapse:collapse" border="0" cellpadding="0" cellspacing="0">
  <tbody>
    <tr>
      <td class="first_td">
        <p><b><span style="font-size:10.0pt;" lang="DE-CH">Constellium   Specialty Sheet</span></b></p>
        <p><span style="font-size:10.0pt" lang="DE-CH">Engineered   Products Switzerland Ltd.</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="DE-CH">Badische   Bahnhofstrasse 16</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="DE-CH">CH-8212 Neuhausen am Rheinfall</span></p>
        <p><b><span style="font-size:10.0pt" lang="DE-CH"> </span></b></p>
      </td>
      <td style="width:49.6pt; padding:0cm 5.4pt 0cm 5.4pt" valign="top" width="50">
        <p style="margin-right:1.35pt"> </p>
        <p style="margin-right: 1.35pt; "><span style="font-size: 10pt; " lang="ES">T</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="ES">F </span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="ES">Website</span></p>
      </td>
      <td style="width:49.6pt; padding:0cm 5.4pt 0cm 5.4pt" valign="top" width="50">
        <p style="margin-right:1.35pt"> </p>
        <p style="margin-right: 1.35pt; "><span style="font-size: 10pt; " lang="ES">+41 52 674 91 11</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="ES">+41 52 674 96 01</span></p>
        <p style="margin-right:1.35pt"><span style="font-size:10.0pt" lang="ES"><a external="1" target="_blank" href="http://www.constellium.com/">www.constellium.com</a> </span></p>
      </td>
    </tr>
  </tbody>
</table>

The class "first_td" is something that seems to be generated dynamically through Typo3, as the CSS is showing up on index.php. I've tried forcing the column width inline in <td>, but it's still coming out dissonant. Chrome's developer tools isn't any help either; it shows the proper CSS, but readily admits that the column width isn't what it should be.

What am I doing wrong here? Is there something in the code that I'm not seeing, or does Typo3 throw a wrench into things? If you can think of anything, I would be greatly appreciative.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

惯饮孤独 2024-12-21 04:46:19

有几种解决方案

1) 您可以编辑 HTML(有一个按钮“<>”显示 HTML 视图)。编辑所有元素并相应地设置宽度。您需要一些 HTML 知识。

2) 仅在一张表格中使用一种内容元素,以便单元格正确对齐。这比 1) 的工作量更大,但如果您需要向某人添加另一个条目,则会更容易。

3) 使用 tt_address 之类的扩展来编辑内容并呈现它,或者只是创建您自己的表格并通过 TypoScript 或 fe“浏览器”扩展呈现它。因此,您将在特定表中包含内容,然后定义如何通过模板或 TypoScript 呈现内容。

我更喜欢 3),因为如果你知道如何去做,它就不会像 1) 或 2) 那样需要更多工作。如果你想学习TYPO3,只需通过1)或2)修复内容,然后通过3)实现:)

There are several solutions

1) You can edit the HTML (there is a button "<>" to show the HTML view). Edit all elements and set the width accordingly. You need some HTML knowhow.

2) Use only one content element with only one table, so the cells are aligned properly. It is more work then 1), but if you need to add another entry someone, it will be easier.

3) Use an extension like tt_address to edit content and render it, or just create your own table and render it via TypoScript or f.e. "browser" extension. So you will have the content in an specific table and define then how the content should be rendered via Templates or TypoScript.

I would prefer 3), as it would be not more work as 1) or 2) if you know, how to do it. If you want to learn TYPO3, just fix the content via 1) or 2) and then implement it via 3) :)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文