gpt4 book ai didi

html - 如何对齐 HTML 中的文本?(Netsuite 高级 PDF)

转载 作者:太空宇宙 更新时间:2023-11-04 00:41:13 25 4
gpt4 key购买 nike

我正在用阿拉伯语创建高级 PDF。它是一种只有阿拉伯文字的字母。它没有得到证明。我尝试使用 style="text-align: justify; text-justify: inter-word;"<td>以及 <span>但仍然没有用。

谁能告诉我是否可以证明阿拉伯语是正确的?我的脚本 block :

<?xml version="1.0"?>
<!DOCTYPE pdf PUBLIC "-//big.faceless.org//report" "report-1.1.dtd">
<!-- <pdf dir="rtl" lang="ar"> -->
<pdf>

<head>
<!-- arabic Font -->
<link name="majalla" type="font" subtype="opentype"
src="https://5486702.app.netsuite.com/core/media/media.nl?id=8627&amp;c=5486702&amp;h=3e47c429eda24f454f39&amp;_xt=.ttf"
bytes="6" />
<style type="text/css">
body {
font-family: majalla;
font-size: 18pt;
}
</style>
</head>

<body font-famly="ariel" header="nlheader" header-height="14%" footer="nlfooter" footer-height="20pt"
padding="0.5in 0.7in 0.5in 0.7in" size="Letter">
<table width="100%" table-layout="fixed">
<tr margin-top="10px">
<td align="right" lang="Ar">
<#if record.custbody7?has_content>
<p align="right"><span align="right" style="text-align: justify; text-justify: inter-word;">${record.custbody7}</span>
<#else>
<p align="right" style="text-indent: 35px;"><span align="right">أفيدكم بأنه لا مانع لدينا من قيامكم
بتنفيذ المشروع أعلاه وذلك لمدة </span>
<span align="right" style="text-align: justify; text-justify: inter-word;">(
${record.custbody_duration?string?replace('0','٠')?replace('1','١')?replace('2','٢')?replace('3','٣')?replace('4','٤')?replace('5','٥')?replace('6','٦')?replace('7','٧')?replace('8','٨')?replace('9','٩')}
)</span> <!-- duration -->
<span align="right" style="text-align: justify; text-justify: inter-word;"> تبدأ من تاريخ </span>
<span align="right" style="text-align: justify; text-justify: inter-word;">${record.custbody_start_date?string?replace('0','٠')?replace('1','١')?replace('2','٢')?replace('3','٣')?replace('4','٤')?replace('5','٥')?replace('6','٦')?replace('7','٧')?replace('8','٨')?replace('9','٩')}
م ، </span> <!-- start date -->
</#if>
<span align="right" style="text-align: justify; text-justify: inter-word;">ومن ثم ترفع المطالبات للإدارة المالية بتقديم جميع المستندات المؤيدة للصرف علًما بأن أصل
هذا التعميد لدى الإدارة المالية في مكتب برنامج خدمة ضيوف الرحمن. </span>
</p>
</td>
</tr>
</table>
</body>
</pdf>

最佳答案

在几个地方你正在使用 <span align="right"> .这里存在三个问题:

1.) span是一个内联元素——在内联元素中使用文本对齐是没有用的。使用 div而不是 span .这是一个 block 元素,它的默认宽度是其父元素的全宽,因此文本对齐会产生影响。

2.) align="right"不是有效的 HTML 属性。如果您想将对齐方式添加到元素,如 div直接,你必须使用<div style="text-align: right;"> .或者(更好)您将一个类应用到 DIV 并为该类设置一个包含所需文本对齐的 CSS 规则。如果您希望文本对齐,请使用 <div style="text-align: justify;">相反。

3.) 对于从右到左书写的语言,您不仅要使用右对齐,还要添加文本方向参数,如direction: rtl;。 (“从右到左”),所以加起来就是 <div style="text-align: justify; direction: rtl;"> ,或者(更好)一个类的 CSS 规则,其中包含您应用于 HTML 标记的那些设置。

关于html - 如何对齐 HTML 中的文本?(Netsuite 高级 PDF),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58271436/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com