Wrap text in table with tabularray package

tablestabularray

I just created a table with tabularray package, but some columns with text are overflowing as shown. How to wrap text in cells like in microsoft word?. Thanks for all the help!

[![enter image description here][1]][1]

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T5]{fontenc}
\usepackage{tabularray}
\usepackage[fontsize=12pt]{scrextend}%font mặc định
\usepackage[paperheight=21cm,paperwidth=29.7cm,right=2cm,left=3cm,top=2cm,bottom=2cm]{geometry}%font a4
\begin{document}
 \setstretch{1}
 \SetTblrInner{rowsep=0pt}
 \noindent
 \begin{tblr}{width=1\linewidth,hlines,vlines,
 colspec={X[1.5,c]X[4,l]X[3,c]X[5,c]X[4,c]X[2,c]X[6,l]X[2,c]X[2,c]X[2,c]X[2,c]},
 rows={1.5cm,m},row{1}={font=\bfseries,c}}
STT&Mã cơ sở&SDKKD&Tên cơ sở&Tài khoản kết nối&Loại hình&Địa chỉ&Tỉnh/ Thành phố&Quận/ Huyện&Xã/ Phường&Tên người đại diện&Tên người đại diện\\
1&26-002053&01174/ĐKKDD-VP&QUẦY THUỐC ANH HẰNG&gpp\_26\_002053\_01174&Quầy thuốc&Thôn Nghị Oản Trung, xã Ngọc Mỹ&Tỉnh Vĩnh Phúc&Lập Thạch&Ngọc Mỹ&Lê Đức Anh &Lê Đức Anh \\
2&26-002052&00363/ĐKKDD-VP&NHÀ THUỐC HỒNG NHUNG&gpp\_26\_002052\_00363&Nhà thuốc&Số 47, đường Bà Triệu, phường Liên Bảo&Tỉnh Vĩnh Phúc&Thành phố Vĩnh Yên&Liên Bảo&Cao Văn Lân &Cao Văn Lân \\
3&26-002051&01173/ĐKKDD-VP&QUẦY THUỐC LONG PHƯƠNG&gpp\_26\_002051\_01173&Quầy thuốc&Khu chợ Đạo Trù, thôn Tân Tiến, xã Đạo Trù&Tỉnh Vĩnh Phúc&Tam Đảo&Đạo Trù 1&Đỗ Thị Bích Phương &Đỗ Thị Bích Phương \\
4&26-002050&01172/ĐKKDD-VP&QUẦY THUỐC QUÂN Y 103&gpp\_26\_002050\_01172&Quầy thuốc&Thôn Hủng 1, xã Đạo Tú&Tỉnh Vĩnh Phúc&Tam Dương&Đạo Tú&Lê Thu Hoài &Lê Thu Hoài\\
 \end{tblr}
 \end{document}


Best Answer

Try to redistribute columns width and use smaller fonts. For example as is done in the following NWE:

\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage[T5]{fontenc}
\usepackage{tabularray}
%\usepackage[fontsize=12pt]{scrextend}%font mặc định
\usepackage[landscape, 
            hmargin={2cm,3cm},vmargin=2cm]{geometry}%font a4

\begin{document}
\SetTblrInner{rowsep=0pt}
 \noindent
\begin{tblr}{hlines,vlines,
             colspec={c c c X[3,c] 
                      c X[1.5,c] X[3.5,l] X[1.5,c] 
                      X[1.6,c] X[1.5,c] X[1.5,c] X[2,c]},
             colsep=3pt,
             rowsep=3pt,
             rows={font=\small,m},
             row{1}={font=\footnotesize\bfseries,c}}
STT &{Mã\\ cơ sở}   &SDKKD      &Tên cơ sở              
    &{Tài khoản\\ kết nối} 
                    &Loại hình  &{Địa\\ chỉ} &Tỉnh/ Thành phố    
    &Quận/ Huyện    &Xã/ Phường &Tên người đại diện 
                                            &{Tên người\\ đại diện} \\
1   &26-002053  &{01174/\\ĐKKDD-VP} &QUẦY THUỐC ANH HẰNG    &gpp\_26\_002053\_01174&Quầy thuốc&Thôn Nghị Oản Trung, xã Ngọc Mỹ&Tỉnh Vĩnh Phúc&Lập Thạch&Ngọc Mỹ&Lê Đức Anh &Lê Đức Anh \\
2   &26-002052  &{00363/\\ĐKKDD-VP} &NHÀ THUỐC HỒNG NHUNG   &gpp\_26\_002052\_00363&Nhà thuốc&Số 47, đường Bà Triệu, phường Liên Bảo&Tỉnh Vĩnh Phúc&Thành phố Vĩnh Yên&Liên Bảo&Cao Văn Lân &Cao Văn Lân \\
3   &26-002051  &{01173/\\ĐKKDD-VP} &QUẦY THUỐC LONG PHƯƠNG &gpp\_26\_002051\_01173&Quầy thuốc&Khu chợ Đạo Trù, thôn Tân Tiến, xã Đạo Trù&Tỉnh Vĩnh Phúc&Tam Đảo&Đạo Trù 1&Đỗ Thị Bích Phương &Đỗ Thị Bích Phương \\
4   &26-002050  &{01172/\\ĐKKDD-VP} &QUẦY THUỐC QUÂN Y 103  &gpp\_26\_002050\_01172&Quầy thuốc&Thôn Hủng 1, xã Đạo Tú&Tỉnh Vĩnh Phúc&Tam Dương&Đạo Tú&Lê Thu Hoài &Lê Thu Hoài\\
 \end{tblr}
 \end{document}

enter image description here