Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537 Warning: error_log(/data/www/wwwroot/hmttv.cn/caches/error_log.php): failed to open stream: Permission denied in /data/www/wwwroot/hmttv.cn/phpcms/libs/functions/global.func.php on line 537
lt;marquee>...</marquee>普通卷動
<marquee behavior=slide>...</marquee>滑動
<marquee behavior=scroll>...</marquee>預(yù)設(shè)卷動
<marquee behavior=alternate>...</marquee>來回卷動
<marquee direction=down>...</marquee>向下卷動
<marquee direction=up>...</marquee>向上卷動
<marquee direction=right></marquee>向右卷動
<marquee direction=left></marquee>向左卷動
<marquee loop=2>...</marquee>卷動次數(shù)
<marquee width=180>...</marquee>設(shè)定寬度
<marquee height=30>...</marquee>設(shè)定高度
<marquee bgcolor=FF0000>...</marquee>設(shè)定背景顏色
<marquee scrollamount=30>...</marquee>設(shè)定卷動距離
<marquee scrolldelay=300>...</marquee>設(shè)定卷動時間
<!>字體效果
<h1>...</h1>標題字(最大)
<h6>...</h6>標題字(最小)
<b>...</b>粗體字
<strong>...</strong>粗體字(強調(diào))
<i>...</i>斜體字
<em>...</em>斜體字(強調(diào))
<dfn>...</dfn>斜體字(表示定義)
<u>...</u>底線
<ins>...</ins>底線(表示插入文字)
<strike>...</strike>橫線
<s>...</s>刪除線
<del>...</del>刪除線(表示刪除)
<kbd>...</kbd>鍵盤文字
<tt>...</tt> 打字體
<xmp>...</xmp>固定寬度字體(在文件中空白、換行、定位功能有效)
<plaintext>...</plaintext>固定寬度字體(不執(zhí)行標記符號)
<listing>...</listing> 固定寬度小字體
<font color=00ff00>...</font>字體顏色
<font size=1>...</font>最小字體
<font style =font-size:100 px>...</font>無限增大
<!>區(qū)斷標記
<hr>水平線
<hr size=9>水平線(設(shè)定大小)
<hr width=80%>水平線(設(shè)定寬度)
<hr color=ff0000>水平線(設(shè)定顏色)
<br>(換行)
<nobr>...</nobr>水域(不換行)
<p>...</p>水域(段落)
<center>...</center>置中
<!>連結(jié)格式
<base href=位址>(預(yù)設(shè)好連結(jié)路徑)
<a href=位址></a>外部連結(jié)
<a href=位址 target=_blank></a>外部連結(jié)(另開新視窗)
<a href=位址 target=_top></a>外部連結(jié)(全視窗連結(jié))
<a href=位址 target=頁框名></a>外部連結(jié)(在指定頁框連結(jié))
<!>貼圖/音樂
<img src=圖片位址>貼圖
<img src=圖片位址 width=180>設(shè)定圖片寬度
<img src=圖片位址 height=30>設(shè)定圖片高度
<img src=圖片位址 alt=提示文字>設(shè)定圖片提示文字
<img src=圖片位址 border=1>設(shè)定圖片邊框
<bgsound src=MID音樂檔位址>背景音樂設(shè)定
<!>表格語法
<table aling=left>...</table>表格位置,置左
<table aling=center>...</table>表格位置,置中
<table background=圖片路徑>...</table>背景圖片的URL=就是路徑網(wǎng)址
<table border=邊框大小>...</table>設(shè)定表格邊框大小(使用數(shù)字)
<table bgcolor=顏色碼>...</table>設(shè)定表格的背景顏色
<table borderclor=顏色碼>...</table>設(shè)定表格邊框的顏色
<table borderclor=顏色碼>...</table>設(shè)定表格邊框的顏色
<table borderclordark=顏色碼>...</table>設(shè)定表格暗邊框的顏色
<table borderclorlight=顏色碼>...</table>設(shè)定表格亮邊框的顏色
<table cellpadding=參數(shù)>...</table>指定內(nèi)容與格線之間的間距(使用數(shù)字)
<table cellspacing=參數(shù)>...</table>指定格線與格線之間的距離(使用數(shù)字)
<table cols=參數(shù)>...</table>指定表格的欄數(shù)
<table frame=參數(shù)>...</table>設(shè)定表格外框線的顯示方式
<table width=寬度>...</table>指定表格的寬度大小(使用數(shù)字)
<table height=高度>...</table>指定表格的高度大小(使用數(shù)字)
<td colspan=參數(shù)>...</td>指定儲存格合并欄的欄數(shù)(使用數(shù)字)
<td rowspan=參數(shù)>...</td>指定儲存格合并列的列數(shù)(使用數(shù)字)
<!>分割視窗
<frameset cols="20%,*">左右分割,將左邊框架分割大小為20%右邊框架的大小瀏覽器會自動調(diào)整
<frameset rows="20%,*">上下分割,將上面框架分割大小為20%下面框架的大小瀏覽器會自動調(diào)整
<frameset cols="20%,*">分割左右兩個框架
<frameset cols="20%,*,20%">分割左中右三個框架
<分割上下兩個框架
<frameset rows="20%,*,20%">分割上中下三個框架
<! - - ... - -> 注解
<a href target> 指定超連結(jié)的分割視窗
<a href=#錨的名稱> 指定錨名稱的超連結(jié)
<a href> 指定超連結(jié)
<a name=錨的名稱> 被連結(jié)點的名稱
<address>....</address> 用來顯示電子郵箱地址
<b> 粗體字
<base target> 指定超連結(jié)的分割視窗
<basefont size> 更改預(yù)設(shè)字形大小
<bgsound src> 加入背景音樂
<big> 顯示大字體
<blink> 閃爍的文字
<body text link vlink> 設(shè)定文字顏色
<body> 顯示本文
<br> 換行
<caption align> 設(shè)定表格標題位置
<caption>...</caption> 為表格加上標題
<center> 向中對齊
<cite>...<cite> 用於引經(jīng)據(jù)典的文字
<code>...</code> 用於列出一段程式碼
<comment>...</comment> 加上注解
<dd> 設(shè)定定義列表的項目解說
<dfn>...</dfn> 顯示"定義"文字
<dir>...</dir> 列表文字標簽
<dl>...</dl> 設(shè)定定義列表的標簽
<dt> 設(shè)定定義列表的項目
<em> 強調(diào)之用
<font face> 任意指定所用的字形
<font face> 任意指定所用的字形
<font size> 設(shè)定字體大小
<form action> 設(shè)定戶動式表單的處理方式
<form method> 設(shè)定戶動式表單之資料傳送方式
<frame marginheight> 設(shè)定視窗的上下邊界
<frame marginwidth> 設(shè)定視窗的左右邊界
<frame name> 為分割視窗命名
<frame noresize> 鎖住分割視窗的大小
<frame scrolling> 設(shè)定分割視窗的卷軸
<frame src> 將html檔加入視窗
<frameset cols> 將視窗分割成左右的子視窗
<frameset rows> 將視窗分割成上下的子視窗
<frameset>...</frameset> 劃分分割視窗
<h1>~<h6> 設(shè)定文字大小
<head> 標示文件資訊
<hr> 加上分格線
<html> 文件的開始與結(jié)束
<i> 斜體字
<img align> 調(diào)整圖形影像的位置
<img alt> 為你的圖形影像加注
<img dynsrc loop> 加入影片
<img height width> 插入圖片并預(yù)設(shè)圖形大小
<img hspace> 插入圖片并預(yù)設(shè)圖形的左右邊界
<img lowsrc> 預(yù)載圖片功能
<img src border> 設(shè)定圖片邊界
<img src> 插入圖片
<img vspace> 插入圖片并預(yù)設(shè)圖形的上下邊界
<input type name value> 在表單中加入輸入欄位
<isindex> 定義查詢用表單
<kbd>...</kbd> 表示使用者輸入文字
<li type>...</li> 列表的項目 ( 可指定符號 )
<marquee> 跑馬燈效果
<menu>...</menu> 條列文字標簽
<meta name="refresh" content url> 自動更新文件內(nèi)容
<multiple> 可同時選擇多項的列表欄
<noframe> 定義不出現(xiàn)分割視窗的文字
<ol>...</ol> 有序號的列表
<option> 定義表單中列表欄的項目
<p align> 設(shè)定對齊方向
<p> 分段
<person>...</person> 顯示人名
<pre> 使用原有排列
<samp>...</samp> 用於引用字
<select>...</select> 在表單中定義列表欄
<small> 顯示小字體
<strike> 文字加橫線
<strong> 用於加強語氣
<sub> 下標字
<sup> 上標字
<table border=n> 調(diào)整表格的寬線高度
<table cellpadding> 調(diào)整資料欄位之邊界
<table cellspacing> 調(diào)整表格線的寬度
<table height> 調(diào)整表格的高度
<table width> 調(diào)整表格的寬度
<table>...</table> 產(chǎn)生表格的標簽
<td align> 調(diào)整表格欄位之左右對齊
<td bgcolor> 設(shè)定表格欄位之背景顏色
<td colspan rowspan> 表格欄位的合并
<td nowrap> 設(shè)定表格欄位不換行
<td valign> 調(diào)整表格欄位之上下對齊
<td width> 調(diào)整表格欄位寬度
<td>...</td> 定義表格的資料欄位
<textarea name rows cols> 表單中加入多少列的文字輸入欄
<textarea wrap> 決定文字輸入欄是自動否換行
<th>...</th> 定義表格的標頭欄位
<title> 文件標題
<tr>...</tr> 定義表格美一行
<tt> 打字機字體
<u> 文字加底線
<ul type>...</ul> 無序號的列表 ( 可指定符號 )
<var>...</var> 用於顯示變數(shù)
者:hh_phoebe
轉(zhuǎn)發(fā)鏈接:https://juejin.im/post/5ee0cf335188254ec9505381
設(shè)有一個 JavaScript 數(shù)組,每個元素都是一個對象,包含了不同類別的數(shù)據(jù)。我們需要將這個數(shù)組中的數(shù)據(jù)按照類別分類合并成一個新的數(shù)組。
舉個例子,假設(shè)原數(shù)組如下:
const dataArray = [
{ category: 'fruit', name: 'apple', price: 1.5 },
{ category: 'fruit', name: 'banana', price: 2.0 },
{ category: 'vegetable', name: 'carrot', price: 0.5 },
{ category: 'vegetable', name: 'potato', price: 0.8 },
{ category: 'meat', name: 'chicken', price: 4.0 },
{ category: 'meat', name: 'beef', price: 6.0 }
];
我們需要將這個數(shù)組按照 category 屬性進行分類合并,得到如下新數(shù)組:
[
{
category: 'fruit',
items: [
{ name: 'apple', price: 1.5 },
{ name: 'banana', price: 2.0 }
]
},
{
category: 'vegetable',
items: [
{ name: 'carrot', price: 0.5 },
{ name: 'potato', price: 0.8 }
]
},
{
category: 'meat',
items: [
{ name: 'chicken', price: 4.0 },
{ name: 'beef', price: 6.0 }
]
}
]
下面是實現(xiàn)代碼:
const mergedArray = dataArray.reduce((acc, cur) => {
const existingCategory = acc.find(item => item.category === cur.category);
if (existingCategory) {
existingCategory.items.push({ name: cur.name, price: cur.price });
} else {
acc.push({ category: cur.category, items: [{ name: cur.name, price: cur.price }] });
}
return acc;
}, []);
首先使用 reduce() 方法對原數(shù)組進行遍歷,累加器 acc 初始值為空數(shù)組。對于每個元素 cur,判斷其 category 屬性是否已存在于 acc 中,如果存在,則將該元素添加到對應(yīng)的 items 數(shù)組中;否則,創(chuàng)建一個新的對象,將該元素添加到 items 數(shù)組中,并添加到 acc 中。最后返回累加器 acc。
*請認真填寫需求信息,我們會在24小時內(nèi)與您取得聯(lián)系。