单元格中日期和日期的单独对齐样式

Separate align style for day and date in a cell

本文关键字:日期 对齐 样式 单独 单元格      更新时间:2023-09-26

我有一个单元格,其中包含日期(星期一11/21/2011)。问题在于格式。我希望日期部分左对齐到单元格,而日期部分右对齐。

cellApplyToDate.append(_this.WeekDays.getString(applyToDate.getDay()).substr(0, 3) + "  " + formatDate(data.ApplyToDate));

上面的代码在没有格式化的情况下向单元格追加数据。请建议。

var cellDate = $("<div style='width:100%; display:inline-block' />");
$("<div style='text-align:left; display:inline-block; width:30%'/>").text(_this.WeekDays.getString(applyToDate.getDay()).substr(0, 3)).appendTo(cellDate);
$("<div style='text-align:right; display:inline-block; width:70%'/>").text(formatDate(data.ApplyToDate)).appendTo(cellDate);
cellApplyDate.append(cellDate);